<php>
	$this->display(tpl('head',true));
</php>
	<style>
		.layui-form-checkbox {
		    position: relative;
		    height: 20px;
		    line-height: 20px;
		    margin-right: 10px;
		    padding-right: 20px;
		}
		.layui-form-checkbox i {
		    width: 22px;
		    font-size: 15px;
		}
		.none{
			text-align: center;
			width: 100%;
			float: left;
			font-size: 2em;
			font-weight: bold;
			padding: 20px 0;
			color: red;
		}
	</style>
	<fieldset class="layui-elem-field layui-field-title">
	  	<legend>升级检测</legend>
	</fieldset>
	
	<form class="layui-form" method="post" action="/admin/upgrade/post/">
		<if condition="$mvc">
		<table class="layui-table  my-tabel">
			<thead>
				<th>主程序升级</th>
			</thead>
			<tbody>
				<tr>
					<td>
						<foreach array="data['mvc']">
						<table class="layui-table  my-tabel">
							<thead>
								<th width="50"><input type="checkbox" lay-skin="primary" name="iddbs[mvc][{{$row['id'] }}]" value="{{$row['version'] }}" /></th>
								<th> {{ $row['title'] }}</th>
								<th width="100">
									版本号：{{ $row['version'] }}
								</th>
								<th width="135">
									更新时间：{{date('Ymd',$row['uptime']) }}
								</th>
							</thead>
							<tbody>
								<tr>
									<td colspan="4">
										{{htmlspecialchars_decode( $row['content']) }}
									</td>
								</tr>
							</tbody>
						</table>
						</foreach>
						<if condition="!$data['mvc']">
							<span class='none'>暂无更新</span>
						</if>
					</td>
				</tr>
			</tbody>
		</table>
		</if>
		<if condition="!$data['modular']">
		<table class="layui-table  my-tabel">
			<thead>
				<th>模块升级</th>
			</thead>
			<tbody>
				<tr>
					<td>
						<foreach array="data['modular']">
						<table class="layui-table  my-tabel">
							<thead>
								<th width="50">{{$row['name']}}<php>unset($row['name'])</php></th>	
							</thead>
							<tbody>
								<tr>
									<td>
										<foreach array="row" value="_row">
											<table class="layui-table  my-tabel">
												<thead>
													<th width="50"><input type="checkbox" lay-skin="primary" name="iddbs[modular][{{$key }}][{{$_row['id'] }}]" value="{{$_row['version'] }}" /></th>
													<th> {{ $_row['title'] }}</th>
													<th width="100">
														版本号：{{ $_row['version'] }}
													</th>
													<th width="135">
														更新时间：{{date('Ymd',$_row['uptime']) }}
													</th>
												</thead>
												<tbody>
													<tr>
														<td colspan="4">
															{{htmlspecialchars_decode( $_row['content']) }}
														</td>
													</tr>
												</tbody>
											</table>
										</foreach>
										<if condition="!$row">
											<span class='none'>暂无更新</span>
										</if>
									</td>
								</tr>
							</tbody>
						</table>
						</foreach>
					</td>
				</tr>
			</tbody>
		</table>
		</if>
		<if condition="$data['plugin']">
		<table class="layui-table  my-tabel">
			<thead>
				<th>插件升级</th>
			</thead>
			<tbody>
				<tr>
					<td>
						<foreach array="data['plugin']">
						<table class="layui-table  my-tabel">
							<thead>
								<th width="50">{{$row['name'];}} <php>unset($row['name'])</php></th>	
							</thead>
							<tbody>
								<tr>
									<td>
										<foreach array="row" value="_row">
											<table class="layui-table  my-tabel">
												<thead>
													<th width="50"><input type="checkbox" lay-skin="primary" name="iddbs[plugin][{{$key }}][{{$_row['id'] }}]" value="{{$_row['version'] }}" /></th>
													<th> {{ $_row['title'] }}</th>
													<th width="100">
														版本号：{{ $_row['version'] }}
													</th>
													<th width="135">
														更新时间：{{date('Ymd',$_row['uptime']) }}
													</th>
												</thead>
												<tbody>
													<tr>
														<td colspan="4">
															{{htmlspecialchars_decode( $_row['content']) }}
														</td>
													</tr>
												</tbody>
											</table>
										</foreach>
										<if condition="!$row">
											<span class='none'>暂无更新</span>
										</if>
									</td>
								</tr>
							</tbody>
						</table>
						</foreach>
					</td>
				</tr>
			</tbody>
		</table>
		</if>
		<table class="layui-table  my-tabel">	
			<tbody>
				<tr>
					<td>
						<input type="hidden" name="upgrade_temporary_number" value="{{$data['upgrade_temporary_number'] }}" />
						<input type="hidden" name="step" id="step" value="post" />
						<button class="layui-btn">立即更新</button>
					</td>
				</tr>
			</tbody>
		</table>
	</from>
<script>
	$('#load').remove();
	layui.config({
			version: '{{NOWTIME }}'
	});
	layui.use(['form'], function(){
	  	var $ = layui.jquery
		var form = layui.form;
	});
</script>
<php> $this->display(tpl('foot',true)); </php>
